---
order: 0
title: Live region
description: An optional package for that enables screen reader messaging for alternative flows.
---

import SectionMessage from '@atlaskit/section-message';

This package can be used to provide
[post drop announcements](/components/pragmatic-drag-and-drop/accessibility-guidelines) for
assistive technology users.

<SectionMessage>

This package does not depend on any view library, or on any other `@atlaskit` package.

</SectionMessage>

## Announce a message

The `announce` function announces the provided message to assistive technology.

Internally, a single live region will be created and reused across function calls. The live region
is created with `role="alert"`, equivalent to setting:

- `aria-live="assertive"`, meaning that messages will be announced immediately and interrupt any
  message currently being announced.
- `aria-atomic="true"`, meaning that messages will always be read in full.

```ts
import { announce } from '@atlaskit/pragmatic-drag-and-drop-live-region';

announce('Task "Clean dishes" moved to list "Doing" from "Todo".');
```

## Cleanup live region

The `cleanup` function will remove the live region created by announce from the DOM.

If a live region does not exist, no error will be thrown and nothing will happen. This means that
the function is safe to call optimistically.

```ts
import { cleanup } from '@atlaskit/pragmatic-drag-and-drop-live-region';

cleanup();
```
